Blockchain provides data storage in a decentralized fashion by keeping the data in a series of data blocks having precedence relationship between each other. The chain of blocks is maintained and updated by a network of blockchain nodes, which are also responsible for validating data under a consensus scheme. The stored data may include many data types, such as financial transactions among parties, historical access information, etc.
Many blockchains (e.g., the Ethereum blockchain) have enabled blockchain contracts (also referred to as smart contracts) that are executed through blockchain transactions. Blockchain transactions are signed messages originated by externally owned accounts (e.g., blockchain accounts), transmitted by the blockchain network, and recorded in the blockchain. The blockchain contracts may be written to achieve various functions, such as adding data to blockchain accounts, changing data in the blockchain, etc. Thus, the blockchain can be maintained and updated by executing various blockchain transactions.
In existing blockchain schemes, each blockchain node needs to execute the various blockchain transactions to maintain the blockchain. After a consensus is reached, all blockchain nodes need to execute the same transactions in an agreed order to keep local copies of the blockchain synchronized. Because each execution requires significant computing power, a lot of computing resources are consumed in repetitive computations. As the complexity of the blockchain transaction algorithm scales up, the redundancy issue will be even more significant. Further, as most blockchain transactions are constructed for individual needs and do not account for other contemporaneously executed blockchain transactions, the execution efficiency for these blockchain transactions is low.
For example, to update blockchain data, a client locally retrieves each local account and its corresponding locally-maintained private key. In the same local environment, the client signs a blockchain transaction for the local account with the local account's private key. Then, the client sends the signed blockchain transaction for execution in blockchain. As a result, the blockchain transactions are executed one at a time. Moreover, the client has to store and manage the local account's blockchain address and public-private keys, which puts burden on the client for maintaining storage and security. Further, because the blockchain transaction is independently written by the client in a closed environment, a slight mistake may cause execution errors for the entire blockchain transaction and potentially incur a great financial loss. Without continuous resource investment, security protocols maintained by the client may become obsolete or outdated or harbor loopholes, which may lead to security breaches to the blockchain system.